package com.tianlu.store.controller;

import com.tianlu.store.common.NoCheckToken;
import com.tianlu.store.common.ResponseResult;
import com.tianlu.store.entity.SysRegion;
import com.tianlu.store.service.SysRegionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
 
/**
 * @Author 梁东烂
 * @Desc (SysRegion)表控制层
 * @Date 2023-04-28 18:17:35
 */
@Api(tags = "地区表")
@RestController
@RequestMapping("/api/sysRegion")
@RequiredArgsConstructor
public class SysRegionController {
	@Resource
    private SysRegionService sysRegionService;

	@ApiOperation("省市区")
    @PostMapping("/regionTree")
    @NoCheckToken
    public ResponseResult<List<SysRegion>> regionTree() {
        return ResponseResult.success(sysRegionService.regionTree());
    }

}
